<template>
  <div>
    <!-- 三级分类导航 -->
    <TypeNav />
    <!-- 列表 -->
    <ListContainer />
    <!-- 今日推荐 -->
    <Recommend />
    <!-- 商品排行 -->
    <Rank />
    <!-- 喜欢 -->
    <Like />
    <!-- 楼层 -->
    <Floor v-for="floor in floorList" :key="floor.id" :floor="floor" />
    <!-- 商标 -->
    <Brand />
  </div>
</template>
<script>
import { defineComponent } from 'vue';
export default defineComponent({
  name: 'Home',

});
</script>

<script setup>
import { onMounted, computed } from 'vue';

import TypeNav from '../../components/TypeNav/index.vue';
import ListContainer from './ListContainer/index.vue';
import Recommend from './Recommend/index.vue';
import Rank from './Rank/index.vue';
import Like from './Like/index.vue';
import Floor from './Floor/index.vue';
import Brand from './Brand/index.vue';
import { useHomeStoreListData } from '../../stores/home';

const storeListData = useHomeStoreListData();
onMounted(() => {
  storeListData.getFloorData();
});
// 将数据存储到计算属性里
const floorList = computed(() => {
  return storeListData.floorList;
});
</script>
